<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>购物车</title>
    <script type="text/javascript" src="jquery/jquery-3.1.1.min.js"></script>
    <link rel="stylesheet" href="layui/css/layui.css">
    <script type="text/javascript" src="js/shop.js"></script>
    <script src="js/jquery.js"></script>
    <script src="js/shop_car.js"></script>
    <style type="text/css">
        ul {list-style-type: none;margin: 0;padding: 0;overflow: hidden;}
        li {float: left;}
        li a {display: block;color: white;text-align: center;padding: 14px 16px;text-decoration: none;}
        li a:hover {background-color: #ababab;}
        /*#top{width:800px;height:50px;margin-top:25px;}*/
        #top{width:800px;height:50px;font-size: 25px}
    </style>
</head>
<body background="images/beijing2.png">
<center>
<div id="top">
    <ul>
        <li><a href="index.jsp" style="width:150px;">首页</a></li>
        <li><a href="#" style="width:150px;">个人中心</a></li>
        <li><a href="yijian.jsp" style="width:150px;">提出意见</a></li>
        <li><a href="#" style="width:150px;">关于我们</a></li>
    </ul>
</div>
    <hr style="height:0px;border:none;border-top:3px solid #d8d86b;"/>
<div id="v-top2">
    <span class="sp1" style="font-size: large;color: white">我的购物车</span>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <span class="sp2"style="font-size: large;color: white">温馨提示：产品是否购买成功，以最终下单为准哦，请尽快结算</span>
</div>
<div id="app" style="font-size: large;color: white">
    <div class="shoppingBar">
        <h2>购物清单</h2>
        <table border="1" id="data_table" lay-filter="parse-table-demo">
            <tr>
                <th width="80px">商品名称</th>
                <th width="400px">商品图片</th>
                <th width="200px">数量</th>
                <th width="80px">单价（元）</th>
                <th width="100px">金额（元）</th>
                <th width="120px">操作</th>
            </tr>
            <c:forEach items="${goods_shopsList}" var="user">
                <tr align="center">
                    <td><p id="p_1">${user.shop_name}</p></td>
                    <td width="400px"><img  id="img1" src="${user.goods_url}" align="center" width="400px" height="200px"></td>
                    <td >
                        <button type="button" class="layui-btn" onclick="add(${user.shop_id})" >+</button>
                        <input name="nums" type="text" value="${user.shop_num}" id="shop_num_${user.shop_id}" size="3" style="text-align: center">
                        <button type="button" class="layui-btn" onclick="jian(${user.shop_id})">-</button>
                    </td>
                    <td><p1 id="shop_price_${user.shop_id}">￥${user.shop_price}</p1></td>
                    <td><p1 id="shop_total_${user.shop_id}">￥${user.shop_total}</p1></td>
                    <td><button type="button" class="layui-btn" onclick="delt(${user.shop_id},this)">删除</button></td>
                </tr>
            </c:forEach>
            <tr >
                <td colspan="2" align="center"><a href="food.jsp"><button class="layui-btn" type="button">继续购物</button></a></td>
                <td colspan="3" style="text-align: center">
                    <span id="shops_allnum"></span>件商品总计:￥
                    <span id="shop_allprice"></span>
                </td >
                <td align="center"><button type="button" class="layui-btn" onclick="postshops()">提交订单</button></td>
            </tr>
        </table>
    </div>
</div>
</center>
<hr style="height:0px;border:none;border-top:3px solid #d8d86b;"/>
<div id="foot" style="color: white;">
    <center>
        ©皮皮虾网团购 pipixiawaimai.com &nbsp;&nbsp;京ICP证12345678号 &nbsp;&nbsp;京ICP备12345679号<br/>
        食品经营许可证&nbsp;&nbsp;互联网美食证<br />
        版权 ©runoob.com
    </center>
</div>
</body>
</html>